<template>
  <div class="power_detail">
    <div class="mask" @click="close" v-show="mask"></div>
    <div class="head">
      <div class="h-head">
        <div class="left" @click="$router.back(-1)">
          <img src="../../assets/left.png" alt />
        </div>
        <div class="center">云算力详情</div>
        <div class="right">
          <img src="../../assets/sg.png" @click="$router.push('/power_order')" alt />
          <div class="s_list" v-show="isshow">
            <div class="s_block">
              <router-link to="/myorder">我的订单</router-link>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="c_block">
      <div class="n_block">
        <div class="top">
          <div class="left">
            <span>永续</span>
            <div class="rx"></div>
          </div>
          <div class="right">
            <span class="ll1">33.53</span>
            <span class="ll2">USFT</span>
          </div>
        </div>
        <div class="bottom">
          <span>算力周期</span>
          <span>单价≈￥&nbsp;288.00</span>
        </div>
      </div>
    </div>
    <div class="c_center">
      <div class="ll">
        <span>
          <span class="g_color">剩余电量：</span> 3468T
        </span>
        <div class="jsj">
          <div class="jian" @click="jian()">-</div>
          <input class="num" type="number" v-model="num" />
          <div class="add" @click="add()">+</div>
        </div>
      </div>
      <div class="ll">
        <span>
          <span class="g_color">电费/度：</span>
          <span>¥0.38</span>
        </span>
        <span>
          <span class="g_color">管理费:</span>11%
        </span>
      </div>
      <div class="ll">
        <span>
          <span class="g_color">每T功耗：</span>0.085KWH/h
        </span>
        <span>
          <span class="g_color">运维费/度：</span>¥0.07
        </span>
      </div>
      <div style="text-align:left">
        <span class="g_color">预计日收入:</span>
        <span>234BCT/T</span>
      </div>
      <div class="ll">
        <span>
          <span class="g_color">收益日期：</span>2019-10-30
        </span>
        <span>
          <span class="g_color">静态回本天数:</span>天
        </span>
      </div>
    </div>
    <div class="gml">
      <img src="../../assets/gml.png" alt />
    </div>
    <div class="rq">
      <span>今日</span>
      <span style="margin-left:.36rem">次日</span>
      <span>第三天</span>
    </div>
    <div class="gmsl">
      <span>购买算力</span>
      <span>产生收益</span>
      <span>发放收益</span>
    </div>
    <div class="title font-weight">产品详情</div>
    <div class="cpxq">
      <div class="l_title" style="margin-bottom:.2rem">
        <img src="../../assets/b_icon2.jpg" alt />
        <span class="font-weight">业务说明</span>
      </div>
      <div class="g_color">
        运算力业务是一项支持用户按t按一定周期租赁算力并享受相应收益的业务。目前早i收均系蚂蚁矿机S17系列算力，仅
        支持挖取BTC,周期目前为永续，后期会陆续上线其他周期的云算力产品。
      </div>
      <div class="l_title" style="margin-top:.4rem;margin-bottom:.2rem">
        <img src="../../assets/b_icon2.jpg" alt />
        <span class="font-weight">购买流程</span>
      </div>
      <div class="g_color">
        你需要下载xxxAPP,ffffff
        fdsfaaaaaaaaaaaaaaaa
        affsddddddddddddddddddd
        afdssssssssssssssssssss
        你需要下载xxxAPP,ffffff
        fdsfaaaaaaaaaaaaaaaa
        affsddddddddddddddddddd
        afdssssssssssssssssssss
        你需要下载xxxAPP,ffffff
        fdsfaaaaaaaaaaaaaaaa
        affsddddddddddddddddddd
        afdssssssssssssssssssss
        你需要下载xxxAPP,ffffff
        fdsfaaaaaaaaaaaaaaaa
        affsddddddddddddddddddd
        afdssssssssssssssssssss
        你需要下载xxxAPP,ffffff
        fdsfaaaaaaaaaaaaaaaa
        affsddddddddddddddddddd
        afdssssssssssssssssssss
        你需要下载xxxAPP,ffffff
        fdsfaaaaaaaaaaaaaaaa
        affsddddddddddddddddddd
        afdssssssssssssssssssss
      </div>
    </div>
    <div style="height:2.3rem"></div>
    <div class="b_fix">
      <div class="xy">
        <img v-show="wxz" src="../../assets/wxz.png" @click="xz" alt />
        <img v-show="!wxz" src="../../assets/xz.png" @click="xz" alt />
        <p>
          <span @click="xz">我已阅读并同意</span>
          <router-link to="/agreement" style="color:#546CE3">《购买协议》</router-link>
        </p>
      </div>
      <div class="left">
        <p>
          <span class="ll1">33.53</span>
          <span class="ll2">USDT</span>
        </p>
        <p style="color:#d5d5d5">总计</p>
      </div>
      <div class="send_order" @click="showPopup">提交订单</div>
    </div>
    <div class="con_pay" v-show="wss">
      <img class="gth" src="@/assets/gth.png" alt />
      <p class="tt1">你的账户余额不足</p>
      <div class="bottom">
        <div class="cancel" @click="cancel">取消</div>
        <div class="pay" @click="goTo">去转账</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      wxz: true,
      num: 1,
      wss: false,
      isshow: false,
      mask: false
    };
  },

  created: function() {},
  mounted() {},
  methods: {
    xz() {
      this.wxz = !this.wxz;
    },
    jian() {
      if (this.num > 2) {
        this.num = this.num - 1;
      } else {
        this.num = 1;
      }
    },
    add() {
      this.num = this.num + 1;
    },
    showPopup() {
      this.wss = true;
      this.mask = true;
    },
    cancel() {
      this.wss = false;
      this.mask = false;
    },
    goTo() {
      this.$router.push("/transfer");
    },
    showLj() {
      this.isshow = !this.isshow;
      this.mask = true;
    },
    close() {
      this.isshow = false;
      this.wss = false;
      this.mask = false;
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.f-flex {
  display: flex;
  display: -webkit-flex;
  align-items: center;
}
.f_weight {
  font-weight: bold !important;
}
.g_color {
  color: #b5b5b5;
}
.power_detail {
  .mask {
    background-color: #25262d;
    opacity: 0.4;
    position: fixed;
    width: 100%;
    height: 100%;
  }
  .s_list {
    position: absolute;
    left: 0;
    width: 2.08rem;
    background: #000;
    color: #fff;
    font-size: 0.4rem;
    transform: translateX(-80%);
    .f-flex();
    flex-direction: column;
    top: 0.64rem;
    .s_block {
      padding-top: 0.206667rem;
      padding-bottom: 0.206667rem;
    }
  }
  .s_list:after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 0px;
    width: 0;
    height: 0;
    border-width: 10px;
    border-style: solid;
    border-color: transparent;
    margin-bottom: -8px;
    border-bottom-width: 15px;
    border-bottom-color: currentColor;
    color: #000;
  }
  .con_pay {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 80%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    border-radius: 0.266667rem;
    background: #fff;
    .gth {
      position: absolute;
      top: -0.68rem;
      left: 50%;
      width: 1.36rem;
      height: 1.36rem;
      transform: translateX(-50%);
      -webkit-transform: translateX(-50%);
    }
    .tt1 {
      font-size: 0.48rem;
      color: #474747;
      margin-top: 1.066667rem;
    }
    .tt2 {
      margin-top: 0.106667rem;
      margin-bottom: 0.106667rem;
    }
    .bottom {
      .f-flex();
      font-size: 0.48rem;
      height: 1.333333rem;
      margin-top: 0.266667rem;
      border-top: 1px solid #d6cbcb;
      .cancel {
        height: 100%;
        width: 50%;
        border-right: 1px solid #d6cbcb;
        line-height: 1.333333rem;
      }
      .pay {
        height: 100%;
        width: 50%;
        line-height: 1.333333rem;
        color: #546ce3;
      }
    }
  }
  .head {
    color: #fefeff;
    height: 3.12rem;
    width: 100%;
    background: url(../../assets/b_blue.jpg) no-repeat;
    background-size: cover;
    .f-flex();
  }
  .h-head {
    margin-top: -0.8rem;
    color: #fefeff;
    margin-left: 0.346667rem;
    margin-right: 0.346667rem;
    width: 100%;
    .f-flex();
    justify-content: space-between;
    .left {
      img {
        width: 0.293333rem;
        height: 0.48rem;
      }
    }
    .center {
      font-size: 0.48rem;
    }
    .right {
      position: relative;
      img {
        width: 0.32rem;
        height: 0.346667rem;
      }
    }
  }
  .c_block {
    width: 92%;
    margin-left: 4%;
    border-radius: 0.106667rem;
    background: #fff;
    margin-top: -1.04rem;
    .n_block {
      padding: 0.4rem 0.533333rem;
    }
    .top {
      .f-flex();
      justify-content: space-between;
      .left {
        .f-flex();
        span {
          font-size: 0.48rem;
          color: #000;
          margin-right: 0.1rem;
        }
        .rx {
          font-size: 0.293333rem;
          width: 0.8rem;
          height: 0.4rem;
          line-height: 0.5rem;
          color: #fffefe;
          background: url(../../assets/rxx.png);
          background-size: cover;
        }
      }
      .right {
        .ll1 {
          font-size: 18px;
          color: #000;
          margin-right: 3px;
        }
        .ll2 {
          color: #d5d5d5;
        }
      }
    }
    .bottom {
      .f-flex();
      justify-content: space-between;
      margin-top: 0.213333rem;
      color: #474747;
      color: #000;
    }
  }
  .c_center {
    color: #474747;
    margin: 0.4rem 0.4rem 0.4rem;
    span {
      line-height: 2;
    }
    .ll {
      .f-flex();
      justify-content: space-between;
    }
    .jsj {
      .f-flex();
      height: 0.8rem;
      width: 3.2rem;
      border: 1px solid #d5d5d5;
      border-radius: 4px;
      .jian {
        width: 25%;
        font-size: 0.48rem;
      }
      .num {
        background: transparent;
        border: none;
        height: 0.8rem;
        text-align: center;
        line-height: 0.553333rem;
        width: 50%;
        border-left: 1px solid #d5d5d5;
        border-right: 1px solid #d5d5d5;
      }
      .add {
        width: 25%;
        font-size: 0.48rem;
      }
    }
  }
  .gml {
    img {
      width: 92%;
    }
  }
  .rq {
    .f-flex();
    justify-content: space-between;
    color: #000;
    width: 92%;
    margin-left: 4%;
    margin-top: 0.2rem;
  }
  .gmsl {
    .f-flex();
    margin-top: 0.266667rem;
    justify-content: space-between;
    width: 92%;
    margin-left: 4%;
  }
  .title {
    font-size: 0.48rem;
    text-align: left;
    margin-left: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.26rem;
  }
  .cpxq {
    padding: 0.32rem 0.5rem;
    background: #fff;
    text-align: left;
    .l_title {
      .f-flex();
      font-size: 14px;
      img {
        width: 0.44rem;
        height: 0.44rem;
        margin-right: 0.16rem;
      }
    }
  }
  .xy {
    height: 0.7rem;
    position: fixed;
    bottom: 1.333333rem;
    background: #e2e2e2;
    width: 100%;
    .f-flex();
    justify-content: center;
    left: 50%;
    transform: translateX(-50%);
    img {
      width: 0.296667rem;
      height: 0.296667rem;
      margin-right: 4px;
    }
  }
  .b_fix {
    .f-flex();
    justify-content: space-between;
    height: 1.333333rem;
    background: #fff;
    width: 100%;
    position: fixed;
    bottom: 0;
    .left {
      margin-left: 0.5rem;
      .ll1 {
        font-size: 0.48rem;
        color: #ff1a1a;
      }
      .ll2 {
        font-size: 0.32rem;
        color: #ff1a1a;
      }
    }
    .send_order {
      font-size: 0.48rem;
      width: 2.933333rem;
      height: 1.333333rem;
      background: #546ce3;
      color: #fff;
      line-height: 1.333333rem;
    }
  }
}
</style>

